Skip to content

Conversation

@Ndomi-Nqeketo
Copy link
Collaborator

This pull request introduces mocking infrastructure to improve unit testing for the Kubernetes version provider. The main changes include adding GoMock-generated mocks for key Kubernetes client interfaces, introducing new unit tests that leverage these mocks, and updating dependencies and developer tooling to support mocking.

Testing infrastructure improvements

  • Added GoMock-generated mock for DiscoveryInterface in pkg/mocks/discovery_mock.go, enabling simulation of Kubernetes discovery behavior in tests.
  • Added new unit tests for the Kubernetes version provider in pkg/providers/kubernetesversion/kubernetesversion_test.go, covering various scenarios and making use of the new mocks.

Dependency and tooling updates

  • Added go.uber.org/mock as an indirect dependency in go.mod to support GoMock-based mocking.
  • Added a new mocks task in taskfile.yaml to automate generation of mock files for Interface and DiscoveryInterface using mockgen.

Signed-off-by: Ndomi-Nqeketo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants